﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace library
{
    public partial class showdetail : Form
    {
        public MySqlConnection conn = new DBclass().getConn();
        string ISBN;
        public showdetail(string isbn)
        {
            InitializeComponent();
            this.ISBN = isbn;
        }

        private void showdetail_Load(object sender, EventArgs e)
        {
            string sql = "select uID 用户名,booking_time 预定时间 from booking_info where ISBN=@isbn and booking_status='已预约' order by booking_time";
            MySqlCommand cmd = new MySqlCommand(sql, conn);
            cmd.Parameters.Add("@isbn", MySqlDbType.VarChar, 6).Value = ISBN;
            MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
            DataSet dataSet = new DataSet();
            adapter.Fill(dataSet);
            dataGridView1.DataSource = dataSet.Tables[0];
            
        }
    }
}
